<template>
    <div>
        <a-modal
         class="acceptance-modal"
         :visible="visibleShow"
         title="办理"
         :maskClosable="false"
         :closable="false"
         :destroyOnClose="true"
         width="100%"
         wrapClassName="full-modal"
         >
            <a-spin size="large" :spinning="spinning" :key="spinningKey">
                <div style="margin-bottom: 20px;">
                    <a-button class="blue-btn" type="primary" @click="visibleShow = false">返回</a-button>
                    <a-button style="margin-left: 10px;" class="blue-btn" type="primary" @click="refreshClick()">刷新</a-button>
                </div>
                    <a-tabs v-model:activeKey="activeKey" >
                        <a-tab-pane key="综合评定" tab="综合评定" v-if="formState.fhjmc !== '个人总结'">
                            <a-form
                                layout="inline"
                                :form="form"
                                class="register-form-box"
                            >
                                <a-descriptions bordered size="small">
                                    <a-descriptions-item label="是否参与考评">
                                        <compSelector
                                        v-if="!processingData.examine"
                                        v-model="formState.fsfcykp"
                                        :defaultValue="formState.fsfcykp"
                                        :compType="typeRadio"
                                        @selectHandleChange="selectHandleChange"
                                        :options="[{label:'是',value:'是'},{label:'否',value:'否'}]"
                                        :disabled="formState.fhjmc == '个人总结'"
                                        />
                                        <span v-else>{{ formState.fsfcykp }}</span>
                                    </a-descriptions-item>
                                    <a-descriptions-item label="姓名">{{ formState.fusermc }}</a-descriptions-item>
                                    <a-descriptions-item label="工作单位">{{ formState.fgzdw }}</a-descriptions-item>
                                    <a-descriptions-item label="考核年度">{{ formState.fyear }}</a-descriptions-item>
                                    <a-descriptions-item label="审评员身份">
                                        <compSelector
                                        v-if="!processingData.examine"
                                        v-model="formState.fdqssk"
                                        :defaultValue="formState.fdqssk"
                                        :compType="typeRadio"
                                        dictionaryType="年度考评审评员身份"
                                        :disabled="disabled"
                                        />
                                        <span v-else>{{ formState.fdqssk }}</span>
                                    </a-descriptions-item>
                                    <a-descriptions-item label="廉洁自律情况">
                                        <compSelector
                                        v-if="!processingData.examine"
                                        v-model="formState.fljzlqk"
                                        :defaultValue="formState.fljzlqk"
                                        :compType="typeRadio"
                                        dictionaryType="年度考评-廉洁自律"
                                        :disabled="disabled"
                                        />
                                        <span v-else>{{ formState.fljzlqk }}</span>
                                    </a-descriptions-item>
                                    <a-descriptions-item label="中心选派次数">{{ formState.fzxxpcs }}</a-descriptions-item>
                                    <a-descriptions-item label="实际审评次数">{{formState.fsjjccs}}</a-descriptions-item>
                                    <a-descriptions-item label="出勒率%">{{formState.fcql}}</a-descriptions-item>
                                    <a-descriptions-item label="评价操作" :span="3" v-if="formState.nextNode == '考评复核'">
                                        <a-button class="blue-btn" type="primary" @click="oneClickExcellent">一键优秀</a-button>
                                    </a-descriptions-item>
                                    <a-descriptions-item label="参加审评情况" :span="3">
                                        <!-- <div v-if="!processingData.examine" style="width:120px"> -->
                                            <compSelector
                                            v-if="!processingData.examine"
                                            v-model="formState.fcjjcqk"
                                            :defaultValue="formState.fcjjcqk"
                                            :compType="typeRadio"
                                            dictionaryType="年度考评评级情况"
                                            :disabled="disabled"
                                            />
                                        <!-- </div> -->
                                        <span v-else>{{ formState.fcjjcqk }}</span>
                                    </a-descriptions-item>
                                    <a-descriptions-item label="参加继续教育情况" :span="3">
                                        <!-- <div v-if="!processingData.examine" style="width:120px"> -->
                                            <compSelector
                                            v-if="!processingData.examine"
                                            v-model="formState.fcjjxjyqk"
                                            :defaultValue="formState.fcjjxjyqk"
                                            :compType="typeRadio"
                                            dictionaryType="年度考评评级情况"
                                            :disabled="disabled"
                                            />
                                        <!-- </div> -->
                                        <span v-else>{{ formState.fcjjxjyqk }}</span>
                                    </a-descriptions-item>
                                    <a-descriptions-item label="日常业务能力考核情况" :span="3">
                                        <!-- <div v-if="!processingData.examine" style="width:120px"> -->
                                            <compSelector
                                            v-if="!processingData.examine"
                                            v-model="formState.frcywnlkhqk"
                                            :defaultValue="formState.frcywnlkhqk"
                                            :compType="typeRadio"
                                            dictionaryType="年度考评评级情况"
                                            :disabled="disabled"
                                            />
                                        <!-- </div> -->
                                        <span v-else>{{ formState.frcywnlkhqk }}</span>
                                    </a-descriptions-item>
                                    <a-descriptions-item label="个人年度总结情况" :span="3">
                                        <!-- <div v-if="!processingData.examine" style="width:120px"> -->
                                            <compSelector
                                            v-model="formState.fgrndzjqk"
                                            :defaultValue="formState.fgrndzjqk"
                                            v-if="!processingData.examine"
                                            :compType="typeRadio"
                                            dictionaryType="年度考评评级情况"
                                            :disabled="disabled"
                                            />
                                        <!-- </div> -->
                                        <span v-else>{{ formState.fgrndzjqk }}</span>
                                    </a-descriptions-item>
                                    <a-descriptions-item label="年度综合考评结果" :span="3">
                                        <!-- <div v-if="!processingData.examine" style="width:120px"> -->
                                            <compSelector
                                            v-if="!processingData.examine"
                                            v-model="formState.fndzhkpjg"
                                            :defaultValue="formState.fndzhkpjg"
                                            :compType="typeRadio"
                                            dictionaryType="年度考评评级情况"
                                            :disabled="disabled"
                                            />
                                        <!-- </div> -->
                                        <span v-else>{{ formState.fndzhkpjg }}</span>
                                    </a-descriptions-item>
                                    <a-descriptions-item label="备注" :span="3">
                                        <a-textarea v-if="!processingData.examine" style="width: 100% !important;" v-model:value="formState.fbz" placeholder="请输入备注" :rows="2" :disabled="disabled" />
                                        <p v-else>{{formState.fbz}}</p>
                                    </a-descriptions-item>
                                    <!-- <a-descriptions-item :span="3" class="add-text">
                                        <template v-slot:label>
                                            <span>
                                                <span v-if="formState.fhjmc !== '考评登记' && formState.fhjmc !== '个人总结'" style="font-size: 16px;color: #fc5531;vertical-align: -3px;line-height: 1;">*</span>
                                                退回意见
                                            </span>
                                        </template>
                                        <a-form
                                            layout="inline"
                                            :form="yjForm"
                                            class="register-form-box"
                                        >
                                            <a-form-item class="yj-box-w" v-if="!processingData.examine">
                                                <a-textarea
                                                v-if="processingData.fhjmc !== '考评登记' && processingData.fhjmc !== '个人总结'"
                                                style="width: 100% !important;"
                                                v-model:value="formState.fthyj"
                                                placeholder="请输入退回意见"
                                                :rows="2"
                                                v-decorator="['fthyj',{ initialValue:formState.fthyj, rules: rules.fthyj}]"
                                                />
                                                <span v-else>{{ formState.fthyj }}</span>
                                            </a-form-item>
                                            <span v-else>{{ formState.fthyj }}</span>
                                        </a-form>
                                    </a-descriptions-item>
                                    <a-descriptions-item :span="3" class="add-text" v-if="formState.nextNode !== '流程结束'">
                                        <template v-slot:label>
                                            <span>
                                                <span style="font-size: 16px;color: #fc5531;vertical-align: -3px;line-height: 1;">*</span>
                                                选择办理人
                                            </span>
                                        </template>
                                        <a-form
                                            layout="inline"
                                            :form="inspectionReportForm"
                                            class="register-form-box"
                                        >
                                            <a-form-item class="yj-box-w" v-if="!processingData.examine">
                                                <a-select
                                                    :key="compSelectorkey"
                                                    :options="formState.dbridList"
                                                    mode="multiple"
                                                    placeholder="请选择办理人"
                                                    style="width: 200px"
                                                    v-decorator="['dbrid',{ initialValue:formState.dbrid, rules: rules.dbrid}]"

                                                    >
                                                </a-select>
                                            </a-form-item>
                                            <span v-else>{{ formState.dbrid.join(',') }}</span>
                                        </a-form>
                                    </a-descriptions-item>
                                    <a-descriptions-item :span="3" class="add-text" >
                                        <template v-slot:label>
                                            <span>
                                                <span v-if="processingData.fhjmc !== '个人总结'" style="font-size: 16px;color: #fc5531;vertical-align: -3px;line-height: 1;">*</span>
                                                办理意见
                                            </span>
                                        </template>
                                        <a-form
                                            layout="inline"
                                            :form="inspectionReportForm"
                                            class="register-form-box"
                                        >
                                            <a-form-item class="yj-box-w" v-if="!processingData.examine">
                                                <a-textarea
                                                    @focus="ideaFocusEvent"
                                                    style="width: 100% !important;"
                                                    @blur="ideaBlur"
                                                    @click="ideaClick('办理意见','opinion')"
                                                    placeholder="请输入办理意见"
                                                    :rows="2"
                                                    v-decorator="['opinion',{ initialValue:formState.opinion, rules: rules.opinion}]"
                                                />
                                            </a-form-item>
                                            <span v-else>{{ formState.opinion }}</span>
                                        </a-form>
                                    </a-descriptions-item> -->
                                    <a-descriptions-item v-if="!processingData.examine" label="下个环节" :span="3" class="add-text">
                                        <span style="padding-right: 30px;">{{formState.nextNode}}</span>
                                        短信通知<a-checkbox style="margin-left: 10px;" v-model:checked="formState.smgflag" :disabled="processingData.examine?true:null"></a-checkbox>
                                    </a-descriptions-item>

                                </a-descriptions>
                            </a-form>
                            <a-form layout="inline" style="display: flex;justify-content: center;padding-top: 20px;" v-if="!processingData.examine">
                                <a-form-item v-if="formState.fhjmc !== '考评登记' && formState.fhjmc !== '个人总结'">
                                    <a-button class="blue-btn" type="primary" @click="segmentSubmitClick(3)">退回</a-button>
                                </a-form-item>
                                <a-form-item >
                                    <a-button class="blue-btn" type="primary" @click="segmentSubmitClick(1)">保存</a-button>
                                </a-form-item>
                                <a-form-item >
                                    <a-button class="blue-btn" type="primary" @click="segmentSubmitClick(2)" >提交</a-button>
                                </a-form-item>
                            </a-form>
                        </a-tab-pane>
                        <a-tab-pane key="审评工作统计及工作总结" tab="审评工作统计及工作总结">
                            <a-form
                                layout="inline"
                                :form="inspectionWorkForm"
                                class="register-form-box"
                            >
                                <a-descriptions bordered size="small">
                                    <a-descriptions-item label="考核年度">{{ formState.fyear }}</a-descriptions-item>
                                    <a-descriptions-item label="总结日期" :span="5">{{ formState.fzjkssj }}至{{ formState.fzjjssj }}</a-descriptions-item>
                                    <a-descriptions-item label="姓名">{{ formState.fusermc }}</a-descriptions-item>
                                    <a-descriptions-item label="工作单位">{{ formState.fgzdw }}</a-descriptions-item>

                                    <a-descriptions-item label="审评企业总数">{{ formState.fjcqyzs }}</a-descriptions-item>
                                    <a-descriptions-item label="担任组长(次)">{{ formState.fdrzzcs }}</a-descriptions-item>
                                    <a-descriptions-item label="担任组员(次)">{{ formState.fdrzycs }}</a-descriptions-item>
                                    <a-descriptions-item label="参加审评次数">{{ formState.fcjpscs }}</a-descriptions-item>
                                    <a-descriptions-item :span="5" v-if="!processingData.examine">
                                        <template v-slot:label>
                                            <span>
                                                <span v-if="formState.fhjmc == '个人总结'" style="font-size: 16px;color: #fc5531;vertical-align: -3px;line-height: 1;">*</span>
                                                年度述职报告
                                            </span>
                                        </template>
                                        <a-form
                                            layout="inline"
                                            :form="szForm"
                                            class="register-form-box"
                                        >
                                            <a-form-item class="yj-box-w" v-show="formState.fhjmc == '个人总结'">
                                                <a-textarea
                                                placeholder="请输入年度述职报告"
                                                :rows="16"
                                                style="width: 100%  !important;"
                                                v-model:value="formState.fndszbg"
                                                v-decorator="['fndszbg',{ initialValue:formState.fndszbg, rules: rules.fndszbg}]"
                                                :disabled="formState.fhjmc !== '个人总结'"
                                                />

                                            </a-form-item>

                                        </a-form>
                                        <span v-if="formState.fhjmc !== '个人总结'">
                                            <p
                                            style="width: 100%  !important;background: #fff;color: rgba(0, 0, 0, 0.65);"
                                            >
                                            {{formState.fndszbg}}
                                            </p>
                                        </span>
                                    </a-descriptions-item>
                                    <a-descriptions-item :span="5" label="个人总结" v-else>
                                        <span>{{formState.fndszbg}}</span>
                                    </a-descriptions-item>

                                </a-descriptions>
                            </a-form>
                            <a-form layout="inline" style="display: flex;justify-content: center;padding-top: 20px;" v-if="formState.fhjmc == '个人总结'">
                                <a-form-item >
                                    <a-button class="blue-btn" type="primary" @click="segmentSubmitClick(1)">保存</a-button>
                                </a-form-item>
                                <a-form-item >
                                    <a-button class="blue-btn" type="primary" @click="segmentSubmitClick(2)" >提交</a-button>
                                </a-form-item>
                            </a-form>
                        </a-tab-pane>
                    </a-tabs>
                    <a-modal
                    :title="ideaType"
                    v-model:visible="ideaVisible"
                    @ok="ideaHandleOk"
                    class="idea-modal-box"
                    @cancel="ideaVisible = false"
                >
                    <a-form layout="inline">
                        <a-form-item :label="ideaType" class="pull-input-w">
                            <div style="display: flex;align-items: center;">
                                <vxe-textarea
                                rows="3"
                                @focus="recordCommentsFocus"
                                @blur="recordCommentsBlur"
                                @change="recordCommentsChange"
                                v-model="opinionsText"
                                :placeholder="'请输入或选择'+ideaType"
                                suffix-icon="vxe-icon-search"></vxe-textarea>
                                <a-button style="margin-left: 15px;" class="blue-btn"  type="primary" @click.stop="saveComments" >保存</a-button>
                            </div>
                            <!-- <vxe-input
                            @focus="recordCommentsFocus"
                            @blur="recordCommentsBlur"
                            @change="recordCommentsChange"
                            v-model:value="opinionsText"
                            :placeholder="'请输入或选择'+ideaType"
                            suffix-icon="vxe-icon-search"></vxe-input> -->
                            <div class="opinion-record-box" v-show="isRecordComments">
                                <div v-if="segOpinionsList.length" class="content-box">
                                    <div v-for="(item,index) in segOpinionsList" class="content-for">
                                        <div @click.stop="selectIdea(item)"  class="content-item">
                                            <span class="content-text" v-if="ideaType=='办理意见'" >{{ item.fcontent}}</span>
                                            <span class="content-text" v-else >{{ item.fzdnr}}</span>
                                            <!-- item.fzdnr -->
                                            <a-button class="red-btn" size="small" type="primary" @click.stop="deleteIdea(item)" >删除</a-button>
                                        </div>
                                    </div>
                                </div>
                                <div class="no-data-box" v-else>暂无记录！</div>
                            </div>
                        </a-form-item>
                    </a-form>
                </a-modal>
            </a-spin>
        </a-modal>
    </div>
</template>
<script>
import compSelector from '@/components/compSelector/compSelector.vue'
import {
    deleteBatchIdeaServe,
    handlingOpinionsListServe,
    saveFlow,
    submitFlow,
    returnUpperFlowJob,
    addBatchIdeaServe,
 } from './service/index'
import {typeInput, typeNumber, typeSelect, typeCheckbox, typeRadio} from '@/components/compSearchCriteria/ContractType'
export default {
    components:{
        compSelector
    },
    props:{
        processingData:{
            type:[Array,Object],
            default: () => {},
            required:false
        }
    },
    data(){
        return{
            spinningKey:null,
            spinning:true,
            disabled:false,
            typeRadio:typeRadio,
            formState:{},
            visibleShow:false,
            form:this.$form.createForm(this, { name: 'coordinated' }),
            inspectionReportForm:this.$form.createForm(this, { name: 'inspectionReportForm' }),
            yjForm:this.$form.createForm(this, { name: 'yjFormName' }),
            szForm:this.$form.createForm(this, { name: 'szFormName' }),
            inspectionWorkForm:this.$form.createForm(this, { name: 'inspectionWorkForm' }),
            activeKey:this.processingData.fhjmc == '个人总结'?'审评工作统计及工作总结':'综合评定',

            ideaVisible:false,
            opinionsText:'',
            ideaType:'',
            segOpinionsList:[],
            isRecordComments:false,
            formFieldKey:'',
            compSelectorkey:null,
            rules:{
                fsxmc: [{
                    required: true,
                    message: '请选择事项名称',
                    trigger: 'blur',
                }],
                fsqsj: [{
                    type:'object',
                    required: true,
                    message: '请选择申请时间',
                    trigger: 'blur',
                }],
                fslsj: [{
                    type:'object',
                    required: true,
                    message: '请选择接收时间',
                    trigger: 'blur',
                }],

                fqyid: [{
                    required: true,
                    message: '请选择企业',
                    trigger: 'blur',
                }],
                ftyshxydm: [{
                    required: true,
                    message: '请输入社会信用代码',
                    trigger: 'blur',
                }],
                fqymc: [{
                    required: true,
                    message: '请输入企业名称',
                    trigger: 'blur',
                }],
                dbrid: [{
                    type:'array',
                    required: true,
                    message: '请选择办理人',
                    trigger: 'blur',
                }],
                opinion: [{
                    required: true,
                    message: '请输入办理意见',
                    trigger: 'blur',
                }],
                fthyj: [{
                    required: true,
                    message: '请输入退回意见',
                    trigger: 'blur',
                }],
                fndszbg: [{
                    required: true,
                    message: '请输入年度述职报告',
                    trigger: 'blur',
                }],

            },
        }
    },
    watch:{
        processingData:{
            handler (newval, oldVal) {
                this.spinning = true
                this.formState = {...newval}

                //console.log('已经获取到了',newval)
                if(newval.fhjmc == '个人总结'){
                    this.disabled = true
                    this.activeKey = '审评工作统计及工作总结'
                } else {
                    this.activeKey = '综合评定'
                }

            },
            deep: true
        }
    },
    mounted(){

    },
    updated(){
        this.cancelLoading()
    },
    methods:{
        cancelLoading(){
            let timer = setInterval((val)=>{
                this.spinning = false
                clearInterval(timer);
            },500)
        },
        //一键优秀
        oneClickExcellent(){
            this.formState.fcjjcqk = '优秀'
            this.formState.fcjjxjyqk = '优秀'
            this.formState.frcywnlkhqk = '优秀'
            this.formState.fgrndzjqk = '优秀'
            this.formState.fndzhkpjg = '优秀'
        },
        refreshClick(){
            this.$emit('reviseClick',this.processingData)
            this.spinning = true
            this.spinningKey = Date.now()
            this.cancelLoading()
        },
        selectHandleChange(val){
            if(val == '否'){
                this.disabled = true
                this.formState.fbz='不参与考评'
                this.formState.fdqssk = ''
                this.formState.fljzlqk = ''
                this.formState.fcjjcqk = ''
                this.formState.fcjjxjyqk = ''
                this.formState.frcywnlkhqk = ''
                this.formState.fgrndzjqk = ''
                this.formState.fndzhkpjg = ''
            }else{
                this.disabled = false
                this.formState.fbz=''
            }
        },
        getHandlingOpinionsList(ideaType,val){//查询业务类型
            if(ideaType == '办理意见'){
                handlingOpinionsListServe({ftype1:ideaType,pageNo:1,pageSize:1000,fcontent:this.opinionsText?this.opinionsText:val,fywflcode:this.formState.fywflcode}).then(res=>{
                    if(res.code == 200){
                        //console.log('办理意见',res)
                        this.segOpinionsList = res.result.records
                    }
                })

            }else{
                queryListYwflServe({ftype1:ideaType,fzdnr:val}).then(res=>{
                    if(res.code == 200){
                        //console.log('查询弹窗数据',res)
                        this.segOpinionsList = res.result
                    }
                })
            }

        },
        //弹窗输入框输入
        recordCommentsChange(){
            this.getHandlingOpinionsList(this.ideaType,this.opinionsText)
        },
        //选择弹窗选择
        selectIdea(val){
            this.opinionsText = val.fcontent
            this.isRecordComments = false
        },
        recordCommentsFocus(){
            this.isRecordComments = true
        },
        recordCommentsBlur(){},

        //删除意见
        deleteIdea(val,name){
            if(this.ideaType == '办理意见'){
                deleteBatchIdeaServe({ids:val.id,fywflcode:this.formState.fywflcode}).then(res=>{
                    if(res.code == 200){
                        this.getHandlingOpinionsList('办理意见',this.opinionsText)
                        this.$message.success('删除成功')
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            }
            // else{
            //     spcyRsYwzdxxDeleteServe({id:val.id}).then(res=>{
            //         if(res.code == 200){
            //             this.refreshFunction(name)
            //             this.$message.success('删除成功')
            //         }else{
            //             this.$message.warning(res.message)
            //         }
            //     })
            // }

        },
        ideaHandleOk(){
            this.ideaVisible = false
            // if(this.opinionsText !== this.formField[this.formFieldKey]){


                this.formState[this.formFieldKey] = this.opinionsText
                if(this.formFieldKey == 'opinion'){
                    this.inspectionReportForm.setFieldsValue({
                        opinion:this.opinionsText,
                    });
                }

            // }



        },
        saveComments(){
            this.ideaHandleOk()
            if(this.opinionsText){
                addBatchIdeaServe({ftype1:this.ideaType,fcontent:this.opinionsText,fywflcode:this.formState.fywflcode}).then(res=>{
                    this.getHandlingOpinionsList(this.ideaType,this.opinionsText)
                })
            }
        },
        ideaFocusEvent(){
            // this.ideaBlur()
            this.$nextTick(()=>{
                this.ideaBlur()
            })
        },
        ideaBlur(){},
        //打开弹窗
        ideaClick(val,name){
            this.ideaVisible = true
            this.formFieldKey = name
            this.ideaType = val
            this.opinionsText = this.formState[name]
            this.getHandlingOpinionsList(val,this.opinionsTex)
        },
        segmentSubmitClick(val){
            var that = this
            if(val == 1){
                let data = {
                    fywflcode:this.formState.fywflcode,
                    jobid:this.formState.jobid,
                    ndkpid:this.formState.ndkpid,
                    map:{
                        fsfcykp:this.formState.fsfcykp,
                        fusermc:this.formState.fusermc,
                        fgzdw:this.formState.fgzdw,
                        fdqssk:this.formState.fdqssk,
                        fyear:this.formState.fyear,
                        fljzlqk:this.formState.fljzlqk,
                        fsjjccs:this.formState.fsjjccs,
                        fzxxpcs:this.formState.fzxxpcs,
                        fcql:this.formState.fcql,
                        fcjjcqk:this.formState.fcjjcqk,
                        fcjjxjyqk:this.formState.fcjjxjyqk,
                        frcywnlkhqk:this.formState.frcywnlkhqk,
                        fgrndzjqk:this.formState.fgrndzjqk,
                        fndzhkpjg:this.formState.fndzhkpjg,
                        fbz:this.formState.fbz,
                        fthyj:this.formState.fthyj,
                        fndszbg:this.formState.fndszbg,
                    }
                }
                saveFlow(data).then(res=>{
                    if(res.code == 200){
                        this.$message.success(res.message)
                        this.$emit('success')
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            }else if(val == 2){
                //console.log(1111)
                if(this.formState.fhjmc !== '个人总结'){
                    //console.log(222)
                    let validateData=[]
                    if(this.formState.nextNode == '流程结束'){
                        validateData = ['opinion']
                        //console.log(333)
                    }else{
                        validateData = ['dbrid', 'opinion']
                    }
                    that.inspectionReportForm.validateFields(validateData, { force: true }, (err, values) => {
                        if(!err){
                            let data = {
                                fywflcode:this.formState.fywflcode,
                                jobid:this.formState.jobid,
                                ndkpid:this.formState.ndkpid,
                                dbrid:values.dbrid?values.dbrid.join(','):'',
                                opinion:values.opinion,
                                map:{
                                    fsfcykp:this.formState.fsfcykp,
                                    fusermc:this.formState.fusermc,
                                    fgzdw:this.formState.fgzdw,
                                    fdqssk:this.formState.fdqssk,
                                    fyear:this.formState.fyear,
                                    fljzlqk:this.formState.fljzlqk,
                                    fsjjccs:this.formState.fsjjccs,
                                    fzxxpcs:this.formState.fzxxpcs,
                                    fcql:this.formState.fcql,
                                    fcjjcqk:this.formState.fcjjcqk,
                                    fcjjxjyqk:this.formState.fcjjxjyqk,
                                    frcywnlkhqk:this.formState.frcywnlkhqk,
                                    fgrndzjqk:this.formState.fgrndzjqk,
                                    fndzhkpjg:this.formState.fndzhkpjg,
                                    fbz:this.formState.fbz,
                                    fthyj:this.formState.fthyj,
                                }
                            }
                            submitFlow(data).then(res=>{
                                if(res.code == 200){
                                    this.$message.success(res.message)
                                    this.$emit('success')
                                    this.visibleShow = false
                                }else{
                                    this.$message.warning(res.message)
                                }
                            })
                        }
                    })
                }else{
                    this.szForm.validateFields((err, values) =>{
                        if(!err){
                            let data = {
                                fywflcode:this.formState.fywflcode,
                                jobid:this.formState.jobid,
                                ndkpid:this.formState.ndkpid,
                                dbrid:this.formState.dbrid.join(','),
                                opinion:this.formState.opinion,
                                map:{
                                    fsfcykp:this.formState.fsfcykp,
                                    fusermc:this.formState.fusermc,
                                    fgzdw:this.formState.fgzdw,
                                    fdqssk:this.formState.fdqssk,
                                    fyear:this.formState.fyear,
                                    fljzlqk:this.formState.fljzlqk,
                                    fsjjccs:this.formState.fsjjccs,
                                    fzxxpcs:this.formState.fzxxpcs,
                                    fcql:this.formState.fcql,
                                    fcjjcqk:this.formState.fcjjcqk,
                                    fcjjxjyqk:this.formState.fcjjxjyqk,
                                    frcywnlkhqk:this.formState.frcywnlkhqk,
                                    fgrndzjqk:this.formState.fgrndzjqk,
                                    fndzhkpjg:this.formState.fndzhkpjg,
                                    fbz:this.formState.fbz,
                                    fthyj:this.formState.fthyj,
                                    fndszbg:values.fndszbg,
                                }
                            }
                            submitFlow(data).then(res=>{
                                if(res.code == 200){
                                    this.$message.success(res.message)
                                    this.$emit('success')
                                    this.visibleShow = false
                                }else{
                                    this.$message.warning(res.message)
                                }
                            })
                        }else{
                            this.activeKey = '审评工作统计及工作总结'
                        }
                    })
                }
            }else if(val == 3){


                that.yjForm.validateFields((err, values) => {
                    if(!err){
                        let data = {
                            fywflcode:this.formState.fywflcode,
                            jobid:this.formState.jobid,
                            ndkpid:this.formState.ndkpid,
                            opinion:values.fthyj,
                        }
                        returnUpperFlowJob(data).then(res=>{
                            if(res.code == 200){
                                this.$message.success(res.message)
                                this.$emit('success')
                                this.visibleShow = false
                            }else{
                                this.$message.warning(res.message)
                            }
                        })
                    }
                })
            }
        }
    }
}
</script>
<style lang="less">
.idea-modal-box{
    .ant-modal-content{
        width: 700px !important;
    }
    .ant-modal-body{
        min-height: 500px !important;
    }
    .pull-input-w{
        width: 100%;
        .ant-form-item-control-wrapper{
            width: 85% !important;
        }
    }
}
.ant-modal-title{
    font-weight: 600;
 }
 .ant-modal-header{
    background: #5ca3e5;
 }
 .ant-modal-footer .ant-btn-primary{
    border: 1px solid #5ca3e5 !important;
    background-color: #5ca3e5 !important;
    color: #fff !important;
 }
 .acceptance-modal .ant-modal-header{
    display: none !important;
 }
 .acceptance-modal .ant-modal-footer{
    display: none !important;
 }
 .acceptance-modal .ant-modal-content{
    height: 100vh;
    overflow: auto;
 }
 .full-modal {
  .ant-modal {
    max-width: 100%;
    top: 0;
    padding-bottom: 0;
    margin: 0;
  }
  .ant-modal-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: calc(100vh);
  }
  .ant-modal-body {
    flex: 1;
  }
}
.register-form-box{
    th{
        background: #e6f7ff !important;
        text-align: center;
        width: 180px;
    }
    .ant-form-item-label{
        width: 161px !important;
    }
}
.yj-box-w{
    width: 100%;
    .ant-form-item-control-wrapper{
        width: 100% !important;
    }
}
.ant-divider{
    // margin: 10px 0 !important;
}
//意见记录
.opinion-record-box{
    width: 447px;
    display: flex;
    overflow-y: auto;
    border: 1px solid rgb(233 228 228);
    box-shadow: -1px 25px 20px rgb(233 228 228);
    .content-box{
        width: 100%;
        height: 320px;
        .content-for{
            border-bottom: 1px solid rgb(233 228 228);
            display: flex;
            flex: 1;
            width: 100%;
            .content-item{
                width: 100%;
                padding: 10px 20px;
                display: flex;
                justify-content: space-between;
                align-items: center;
                .content-text{

                }
            }
        }
    }
    .no-data-box{
        width: 100%;
        display: flex;
        padding-right: 20px;
        text-align: center;
        justify-content: center;
        height: 100px;
        line-height: 80px;
    }

}
</style>
